/**
 * Created by kule on 2017/7/7.
 */
import has from 'lodash/has';
import set from 'lodash/set';
import get from 'lodash/get';
export const hasAndUpdate=(
    obj,keyPath,
    updater=val=>val
)=>{
    if(has(obj,keyPath)){
        set(obj,keyPath,updater(get(obj,keyPath)));
    }
};

export default hasAndUpdate;